<template>
    <h2>用户投资赎回列表</h2>
    <table class="table table-border">
        <thead>
            <tr style="background-color: :aqua;">
                <td>投资项目编号</td>
                <td>账号名称</td>
                <td>投资项目总金额</td>
                <td>用户已投金额</td>
                <td>赎回金额</td>
            </tr>
        </thead>
        <tbody>
            <tr v-for="item in data" :key="item.I_Id">
                <td>{{ item.I_Id }}</td>
                <td>{{ item.UL_Name }}</td>
                <td>{{ item.I_Budget }}</td>
                <td>{{ item.UI_Money }}</td>
                <td>{{ item.UIR_Money }}</td>
            </tr>
        </tbody>
    </table>
</template>

<script setup lang="ts">
import 'bootstrap/dist/css/bootstrap.min.css'
import 'bootstrap/dist/js/bootstrap.min.js'
import { useRoute } from 'vue-router'
import axios from 'axios';
import { ref, onMounted } from 'vue';

//路由实例
const route = useRoute();

//取出投资编号
var Iid = route.params.Iid;

const data = ref([{
    I_Id: '',
    UL_Name: '',
    I_Budget: '',
    UI_Money: '',
    UIR_Money: ''
}]);

onMounted(() => {
    axios({
        method: 'get',
        url: 'https://localhost:44305/api/Invests/GetAllUserRedeemInvestInfo',
        params: {
            Iid: Iid
        }
    })
        .then(function (res) {
            data.value = res.data;
        })
})

</script>